home *** CD-ROM | disk | FTP | other *** search
- #!/bin/s
- # the next line restarts using wish \
- exec wish "$0" "$@"
-
- # FreePDF --
- # This script calls GhostScript to convert the
- # PS (PostScript) input file into a PDF on Windows 9x.
- #
- # Free PDF is used as part of
- # a process. This process enables one to Print to a special
- # printer from any Windows application and
- # create output files in the output folder.
- # in a PDF (Adobe's Portable Document Format) file,
- # which is viewable using
- # Adobe's Acrobat product among other programs.
- #
- # Limitations:
- # This version is Now Beta and close to release.
- # It has the location for the GhostScript
- # executable as "C:\Aladdin\gs6.01\bin\gswin32c.exe" ,
- # and the location for the Acrobat Reader
- # executable as
- # "C:\Program Files\Adobe\Acrobat 4.0\Reader\AcroRd32.exe" ,
- # These can be overriden by using the Config Screen
- # and clicking on the links for the files or by
- # editting the file "FREEPDF.INI"
- # in the FreePDF Directory
- #
- # From version 0.28 on you have the 'Save PDF as' button
- # which allows you to place the output PDF file
- # in whatever folder with whatever name you'd like.
- # FreePDF will remember the folder and output name
- # from the last time it was used.
- #
- # This program requires 2 parameters.
- # The 1st is ignored as are any past the 2cnd.
- # The second is the only one used
- # and should contain the full path and filename
- # of the Input PS temporary file to be converted.
- # to a PDF.
- # This is fine as REDRUN handles this
- # Open the file
- # C:\freepdf\dochtml\freepdf.htm for full details
- #
- # It is intended to be used in conjunction with
- #
- # RedMon (Printer port REDirection Monitor)
- # from Ghostgum Software Pty Ltd.,
- # and GhostScript from Aladdin Enterprises.
- # The setup for this whole process is involved.
- # Open the file
- # C:\freepdf\dochtml\freepdf.htm
- # in Internet explorer for full details
- #
- # FreePDF is distributed under the terms of the
- # ALADDIN FREE PUBLIC LICENCE
- # and is Copyright (C) 2000, BMRWare. All rights reserved.
- # See the ASCII file license in this directory for details.
- # Need "Program handles Output" on RPT1 setup
- #
- # RedMon (Printer port REDirection Monitor)
- # is Copyright (C) 1997-1999, Ghostgum Software Pty Ltd.
- # GhostScript is
- # Copyright (C) 1994, 1995, 1997, 1998 Aladdin Enterprises,
- # Menlo Park, California, U.S.A. All rights reserved.
- #
- # RCS: @(#) $Id: FreePDF,v 0.95 2000/05/31 18:23:30 Rhodes Exp $
-
- #----------------------------------------------------------------
- # BEFORE RELEASE MAKE SURE TO DO THE FOLLOWING
- #----------------------------------------------------------------
- # 1 - Set the 'testing' variable to 0
- #----------------------------------------------------------------
-
- # Version Notes
- #+----+----------+------------------------------------------------------------+
- #+Ver |MM/DD/YYYY|Description +
- #+----+----------+------------------------------------------------------------+
- #+0.15|04/01/2000| First version just calls GhostScript +
- #+----+----------+------------------------------------------------------------+
- #+0.20|04/02/2000| Working on Parm madness Need Parm 2! +
- #+----+----------+------------------------------------------------------------+
- #+0.21|04/02/2000| Make call to gswin32.exe Writes "C:\WINDOWS\\Start Menu +
- #+ | | Writes "C:\WINDOWS\Start Menu\Output.pdf' +
- #+----+----------+------------------------------------------------------------+
- #+0.22|04/03/2000| Variablizing the hardcoded paths and program names +
- #+ | | Added buttons to View Output and Exit +
- #+ | | Next will make them configurable +
- #+----+----------+------------------------------------------------------------+
- #+0.23|04/02/2000| Added See Command Button moved screen text around +
- #+----+----------+------------------------------------------------------------+
- #+0.24|04/04/2000| Removed Acrobat save as tip and added adobe coppyright +
- #+----+----------+------------------------------------------------------------+
- #+0.27|04/05/2000| Added Make PDF, About and disabled Configure buttons +
- #+----+----------+------------------------------------------------------------+
- #+0.28|04/06/2000| Added ini file variables, Enabled Configure and +
- #+ | | renamed 'Make pdf' to 'Save PDF as..' buttons +
- #+----+----------+------------------------------------------------------------+
- #+0.30|04/07/2000| Added check that ini file exits and create if needed +
- #+ | | FreePDF also now saves and uses the settings from last time+
- #+----+----------+------------------------------------------------------------+
- #+0.31|04/23/2000| Changed defaults for Aladdin directory +
- #+----+----------+------------------------------------------------------------+
- #+0.32|04/24/2000| Revamped Config Screen! Added Browse Button in Config +
- #+ | | for Finding GhostScript PDF Converter and PDF Viewer! +
- #+ | | Added Automatic Copy to Clipboard of PDF path and name +
- #+ | | of the created PDF upon success +
- #+ | | Added Open PS for selecting PS file when bad parms passed +
- #+----+----------+------------------------------------------------------------+
- #+0.33|05/12/2000| Changed Title in Open file Dialog box for pdfViewer +
- #+----+----------+------------------------------------------------------------+
- #+0.87|05/19/2000| First Beta Release Small bugs Squashed! +
- #+----+----------+------------------------------------------------------------+
- #+0.94|05/26/2000| Added Checkbox Options to Config screen for +
- #+ | | "Show Save as Dialog Automatically", +
- #+ | | "Launch PDF Viewer Automatically After Conversion" and +
- #+ | | "Auto-Exit FreePDF After PDFViewer Close" +
- #+ | |About box is now real window also instead of just Dialog Box+
- #+----+----------+------------------------------------------------------------+
- #+0.95|05/31/2000| Added new Checkbox Options to Config screen for +
- #+ | | "Remind to close PDFViewer +
- #+----+----------+------------------------------------------------------------+
- #
- # List of things to do, future plans and ideas
- #+----------------------------------------------------------------------------+
- # Check content of file for PS header and Abort if absent
- # Log File
- # Configurable Default Output Directory
- # Configurable Default Output File Name
- # 'Save as..' Dialog to name the output
- # Right Click 'Convert to PDF' Explorer Integration
- # Optionally on Completion:
- # Run Acrobat or GhostView to View the Output
- # Zip 'output.pdf'
- # Batch mode with
- # Watched Input and Output Folders
- # Delete Input PS file after Successful PDF Creation Option
- # Update Checker and Downloader
- # Minimize to System Tray?
- # Installer and UNInstaller
- #+----------------------------------------------------------------------------+
-
- # Create the window ('.' is the main window,
- # 'FreePDF v n.nn' is the title)
- #----------------------------------------------------------------
- set pgmName "FreePDF"
- set ver "v0.95 Beta"
- set asofdate "05/31/2000"
- wm title . "$pgmName $ver"
- # toplevel .
-
- #----------------------------------------------------------------
- # Testing Variable
- #----------------------------------------------------------------
- # IMPORTANT SET TO ZERO BEFORE RELEASE!!!
- #----------------------------------------------------------------
- # 0 for release
- # - Suppresses both testing messages
- # - Suppresses 'package require' commands.
- # FREEWRAP provides this and does not work if the
- # the 'package require' command is issued!
- # 1 for testing (Like production)
- # - no messages
- # 2 for testing
- # - all messages turned on
- # - does issues package require command
- #----------------------------------------------------------------
- # Note: Copies of these variables may be retrieved by procedures
- # using the 'upvar" command
- #----------------------------------------------------------------
- eval destroy [winfo child .]
- set testing 0
- set convertflag 0
- set changeflag 0
- set errorflag 0
-
- # RedRun actually gives us the name of the file in the second
- # parameter! Don't know why so instead of 0 (first parameter)
- # we want 1 (second parameter) in lindex!
- set parm1 [lindex $argv 1]
-
- # You can uncomment the set just below to see the actual
- # parameter list sent by RedRun
- # set parm1 $argv
-
- # FreePDF Variables
- #----------------------------------------------------------------
- # These are default values in case freepdf.ini doesn't
- # exist. If it does exist the incoming values from the ini file
- # will overlay these
- set pdfOutFile "Output.pdf"
- set pdfIniFile "freepdf.ini"
- set pdfConverter "C:/Aladdin/gs6.01/bin/gswin32c.exe"
- set pdfViewer "C:/Program Files/Adobe/Acrobat 4.0/Reader/AcroRd32.exe"
-
- # Dynamically retrieve pdfOutDir
- #----------------------------------------------------------------
- set pdfOutDir [file dirname [info nameofexecutable]]/
- set pdfIniFile $pdfOutDir$pdfIniFile
- set pdfSaveAsImmed 0
- set pdfAutoView 1
- set pdfRemindPdfView 1
- set pdfQuickExit 0
-
- #*****************************************************************
- #*****************************************************************
- # U S E R D E F I N E D PROCEDURES FOLLOW
- #*****************************************************************
- #*****************************************************************
-
- #-----------------------------------------------------------------
- # OpenPS - Gets the name of the input PostScript File
- # Only is shown if no parameter were passed which they
- # should be!
- #-----------------------------------------------------------------
- proc OpenPS { } {
- global pgmName \
- ver \
- testing \
- errorflag\
- text1 \
- parm1
-
- set psDir "C:/"
-
- # Type names Extension(s) Mac File Type(s)
- #
- #---------------------------------------------------------
- set types {
- {"PS files" {.ps } }
- {"All files" *}
- }
-
- set file [tk_getOpenFile\
- -filetypes $types\
- -initialdir $psDir\
- -defaultextension .ps\
- -parent .\
- -title "Where is the PostScript Input?"
- ]
- if [string compare $file ""] {
- set parm1 $file
- set text1 "Input file to be converted to PDF is \n<$parm1>\n
- Click the 'Save PDF as..' button, to create your PDF"
- set errorflag 0
- }
- }
-
- #-----------------------------------------------------------------
- # SaveAs - Get Name for Output file
- #-----------------------------------------------------------------
- proc SaveAs { } {
- global pgmName \
- ver \
- testing \
- pdfOutDir \
- pdfOutFile \
- pdfConverter\
- pdfViewer \
- changeflag
-
- # Type names Extension(s) Mac File Type(s)
- #
- #---------------------------------------------------------
- set types {
- {"PDF files" {.pdf } }
- {"All files" *}
- }
- set file [tk_getSaveFile\
- -filetypes $types\
- -initialdir $pdfOutDir\
- -initialfile $pdfOutFile\
- -defaultextension .pdf\
- -parent .\
- -title "$pgmName - Save PDF as "
- ]
- if [string compare $file ""] {
- set pdfOutDir [file dirname $file]/
- set pdfOutFile [file tail $file]
- set changeflag 1
- } else {
- set changeflag 0
- }
- }
-
- #-----------------------------------------------------------------
- # MakePDF - Does 'Save as' and calls GhostScript to convert to pdf
- #-----------------------------------------------------------------
- proc MakePDF { } {
- # remember to check for filein's existence
- # and that gswin32 exists!
- global pgmName \
- ver \
- testing \
- pdfConverter\
- pdfViewer \
- pdfOutDir \
- pdfOutFile \
- text1 \
- text2 \
- parm1 \
- changeflag \
- pdfAutoView
-
-
- if [expr $testing < 1] {
- set oldfile $pdfOutDir$pdfOutFile
- SaveAs
- # changeflag will be 0 if the user hit 'Cancel' in 'Save PDF as'!
- # changeflag will be 1 if the user hit 'Ok' in 'Save PDF as'!
- if [expr $changeflag] {
- WriteIni
- update
- exec $pdfConverter -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite\
- -sOutputFile=$pdfOutDir$pdfOutFile -c save pop -f $parm1
- set text1 "Your PDF is called $pdfOutFile in the\n$pdfOutDir Folder."
- set text2 "Click on The 'View PDF' button Above
- To Open it in Acrobat Reader.
- "
- #*****************************************************************
- #** - v0.31 added copy to clipboard of PDF path and name
- clipboard clear
- clipboard append $pdfOutDir$pdfOutFile
- #*****************************************************************
- if {$pdfAutoView > 0} {
- update
- CallPdfViewer
- }
- }
- }
- }
-
- #-----------------------------------------------------------------
- # CallPdfViewer - Just Views the PDF output
- #-----------------------------------------------------------------
- proc CallPdfViewer { } {
- global pgmName \
- ver \
- testing \
- pdfRemindPdfView \
- pdfQuickExit \
- pdfViewer \
- pdfOutDir \
- pdfOutFile
-
-
- if {$pdfRemindPdfView > 0} {
- tk_messageBox\
- -icon info -type ok \
- -title "$pgmName" \
- -message \
- "Make sure you Remember to Close
- the PDFViewer! Don't just minimize it!"
- }
-
- exec "$pdfViewer" $pdfOutDir$pdfOutFile
-
- if {$pdfQuickExit > 0} {
- update
- destroy .
- }
-
- }
-
- #-----------------------------------------------------------------
- # ReadIni - Read Ini File and set options
- #-----------------------------------------------------------------
- proc ReadIni { } {
- global pgmName \
- ver \
- testing \
- pdfOutDir \
- pdfOutFile \
- pdfIniFile \
- pdfConverter \
- pdfViewer \
- pdfSaveAsImmed\
- pdfAutoView \
- pdfQuickExit \
- pdfRemindPdfView
-
- set existsFlag [file exists $pdfIniFile]
- ## tk_messageBox -icon info -type ok -title "$pgmName $ver ReadIni" \
- ## -message "existsFlag is $existsFlag"
- if {$existsFlag > 0} \
- {
- # Read pdfIniFile
- set read ""
- set readini [open $pdfIniFile r]
- while {[gets $readini read] > -1} {
- set l [string length $read]
- set i [string first = $read]
- if {$i >= 0} \
- {
- set varname [string range $read 0 [expr $i-1] ]
- set varvalue [string range $read [expr $i+1] $l]
- ## tk_messageBox -icon info -type ok -title "$pgmName $ver Configure" \
- ## -message "$pgmName $ver\t line read was\n $read\nvarname is \t$varname\nvarvalue is \t$varvalue\n"
- switch $varname\
- {
- {pdfOutDir}
- {set pdfOutDir $varvalue
- }
- {pdfOutFile}
- {set pdfOutFile $varvalue
- }
- {pdfConverter}
- {set pdfConverter $varvalue
- }
- {pdfViewer}
- {set pdfViewer $varvalue
- }
- {pdfSaveAsImmed}
- {set pdfSaveAsImmed $varvalue
- }
- {pdfAutoView}
- {set pdfAutoView $varvalue
- }
- {pdfQuickExit}
- {set pdfQuickExit $varvalue
- }
- {pdfRemindPdfView}
- {set pdfRemindPdfView $varvalue
- }
-
- } ;# End Switch
- } ;# End if
- }
- close $readini
- } else {
- ## tk_messageBox -icon info -type ok -title "$pgmName $ver ReadPdfIni" \
- ## -message "$pgmName - ReadpdfIni pdfIniFile \n$pdfIniFile\n Not found "
- WriteIni
- }
- }
-
-
- #-----------------------------------------------------------------
- # WriteIni - Writes the FreePDF variables to ini file
- #-----------------------------------------------------------------
- proc WriteIni { } {
- global pgmName \
- ver \
- testing \
- pdfOutDir \
- pdfOutFile \
- pdfIniFile \
- pdfConverter \
- pdfViewer \
- pdfSaveAsImmed\
- pdfAutoView \
- pdfQuickExit \
- pdfRemindPdfView
-
- # Write pdfIniFile
- set writeini [open $pdfIniFile w]
- puts $writeini "<freepdf.ini>"
- puts $writeini "pdfOutDir=$pdfOutDir"
- puts $writeini "pdfOutFile=$pdfOutFile"
- puts $writeini "pdfConverter=$pdfConverter"
- puts $writeini "pdfViewer=$pdfViewer"
- puts $writeini "pdfSaveAsImmed=$pdfSaveAsImmed"
- puts $writeini "pdfAutoView=$pdfAutoView"
- puts $writeini "pdfRemindPdfView=$pdfRemindPdfView"
- puts $writeini "pdfQuickExit=$pdfQuickExit"
- close $writeini
- }
-
- #-----------------------------------------------------------------
- # Configure - Sets paths and executable names
- #-----------------------------------------------------------------
- proc Configure { } {
- global pgmName \
- ver \
- testing \
- pdfOutDir \
- pdfOutFile \
- pdfIniFile \
- pdfConverter \
- pdfViewer \
- pdfSaveAsImmed \
- pdfAutoView \
- pdfQuickExit \
- pdfRemindPdfView \
- asofdate
-
- WriteIni
-
- set w .config
- catch {destroy $w}
- toplevel $w
- wm title $w "$pgmName Configure"
-
- text $w.text -yscrollcommand "$w.scroll set" -setgrid true \
- -width 54 -height 34 -wrap word -background #C0C0C0
- scrollbar $w.scroll -command "$w.text yview"
- pack $w.scroll -side right -fill y
- pack $w.text -expand yes -fill both
-
- # Set up display styles.
-
- # set bold "-foreground #ffff66 -relief raised -borderwidth 1 -underline 0"
- set bold "-foreground #005000 -relief flat -underline 1 -borderwidth 0"
- set normal "-foreground #0000ff -relief flat -underline 1"
-
- foreach tag {d1 d2 d3} {
- $w.text tag configure $tag -underline on -foreground #0000ff
- }
- # Add text to widget.
-
- checkbutton $w.saveAsImmed -text "Show Save as Dialog Automatically"\
- -variable pdfSaveAsImmed -relief flat -command "WriteIni"
- checkbutton $w.autoView -text "Launch PDF Viewer Automatically After Conversion"\
- -variable pdfAutoView -relief flat -command "WriteIni"
- checkbutton $w.remindPdfView -text "Remind me to Close PDFViewer "\
- -variable pdfRemindPdfView -relief flat -command "WriteIni"
- checkbutton $w.quickExit -text "Auto-Exit FreePDF After PDFViewer Close"\
- -variable pdfQuickExit -relief flat -command "WriteIni"
-
- # --- Do the insert into the text -----
- $w.text insert 0.0 \
- "$pgmName $ver\tCurrent as of $asofdate \n
- Greetings from the ZipGuy! \n
- Current settings:
- File executed:\t'[info nameofexecutable]'
- pdfIniFile: \t'$pdfIniFile'
- pdfOutDir: \t'$pdfOutDir'
- pdfOutFile: \t'$pdfOutFile'
-
-
- Click on The Items below to change them!"
-
- $w.text insert end \n\n
- $w.text insert end \
- "pdfConverter\n'"
- $w.text insert end \
- "$pdfConverter" d1
- $w.text insert end '\n\n
-
- $w.text insert end \
- "pdfViewer \n'"
- $w.text insert end \
- "$pdfViewer" d2
- $w.text insert end '\n\n
-
- $w.text window create end -window $w.saveAsImmed
- $w.text window create end -window $w.autoView
- $w.text window create end -window $w.remindPdfView
- $w.text window create end -window $w.quickExit
- $w.text insert end \n
-
- $w.text insert end \n\t\t\t
- $w.text insert end \
- "Exit Config" d3
-
- $w.text insert end "\n
- \t\t Zipguy says 'Enjoy!' ;-)"
-
-
- foreach tag {d1 d2 d3} {
- $w.text tag bind $tag <Any-Enter> "$w.text tag configure $tag $bold"
- $w.text tag bind $tag <Any-Leave> "$w.text tag configure $tag $normal"
- }
-
- $w.text tag bind d1 <1> {ConfigurepdfConverter}
- $w.text tag bind d2 <1> {ConfigurepdfViewer}
- $w.text tag bind d3 <1> "destroy $w"
-
-
- $w.text mark set insert 0.0
- $w.text configure -state disabled
-
- }
-
- #-----------------------------------------------------------------
- # ConfigurepdfConverter - Sets paths and executable name
- # of pdfConverter
- #-----------------------------------------------------------------
- proc ConfigurepdfConverter { } {
- global pgmName \
- ver \
- testing \
- pdfConverter
-
- set gsConverterDir [file dirname $pdfConverter]/
- set gsConverterFile [file tail $pdfConverter]
-
- # Type names Extension(s) Mac File Type(s)
- #
- #---------------------------------------------------------
- set types {
- {"EXE files" {.exe } }
- {"All files" *}
- }
-
-
- set file [tk_getOpenFile\
- -filetypes $types\
- -initialdir $gsConverterDir\
- -initialfile $gsConverterFile\
- -defaultextension .exe\
- -parent .config\
- -title "Locate 'gswin32c.exe' - Ghostscript Executable"
- ]
- if [string compare $file ""] {
- set pdfConverter $file
- WriteIni
- destroy .config
- } else {
- }
- }
-
-
- #-----------------------------------------------------------------
- # ConfigurepdfViewer - Sets paths and executable name
- # of pdfViewer
- #-----------------------------------------------------------------
- proc ConfigurepdfViewer { } {
- global pgmName \
- ver \
- testing \
- pdfViewer
-
- set pdfViewerDir [file dirname $pdfViewer]/
- set pdfViewerFile [file tail $pdfViewer]
-
- # Type names Extension(s) Mac File Type(s)
- #
- #---------------------------------------------------------
- set types {
- {"EXE files" {.exe } }
- {"All files" *}
- }
-
- set file [tk_getOpenFile\
- -filetypes $types\
- -initialdir $pdfViewerDir\
- -initialfile $pdfViewerFile\
- -defaultextension .exe\
- -parent .config\
- -title "Locate 'AcroRd32.exe' - PDFViewer Executable"
- ]
- if [string compare $file ""] {
- set pdfViewer $file
- WriteIni
- destroy .config
- } else {
- }
- }
-
- #-----------------------------------------------------------------
- # SeeCommand -Shows the command issued to GhostScript
- #-----------------------------------------------------------------
- proc SeeCommand { } {
- global pgmName \
- ver \
- testing \
- pdfConverter\
- pdfOutDir \
- pdfOutFile \
- parm1 \
-
- tk_messageBox\
- -icon info -type ok \
- -title "$pgmName $ver" \
- -message \
- "$pgmName $ver - Command issused to convert PS to PDF was:
- $pdfConverter
- -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -c save pop
- -sOutputFile='$pdfOutDir$pdfOutFile'
- -f $parm1 \n
- (Aren't You Glad you didn't have to type it in?)
- If you're curious, see the GhostScript Documentation
- for what all those wacky switches do.
-
- PDF (Portable Doument Format) is
- Copyright ⌐2000 Adobe Systems Incorporated."
- }
-
-
-
- #-----------------------------------------------------------------
- # About - Just Displays the About box - FreePDF information
- #-----------------------------------------------------------------
- proc About { } {
- global pgmName \
- ver \
- testing \
- pdfOutDir \
- pdfOutFile \
- pdfConverter\
- pdfViewer \
- asofdate
-
-
-
- set w .about
- catch {destroy $w}
- toplevel $w
- wm title $w "$pgmName $ver About"
-
- text $w.text -yscrollcommand "$w.scroll set" -setgrid true \
- -width 70 -height 25 -wrap word -background #C0C0C0
- scrollbar $w.scroll -command "$w.text yview"
- pack $w.scroll -side right -fill y
- pack $w.text -expand yes -fill both
-
- # Set up display styles.
-
- # set bold "-foreground #ffff66 -relief raised -borderwidth 1 -underline 0"
- set bold "-foreground #005000 -relief flat -underline 1 -borderwidth 0"
- set normal "-foreground #0000ff -relief flat -underline 1"
-
- foreach tag {d1 d2 d3} {
- $w.text tag configure $tag -underline on -foreground #0000ff
- }
- # Add text to widget.
-
- # --- Do the insert into the text -----
- $w.text insert 0.0 \
- "Recent News:
- v0.95 05/31/2000 Added Another Checkbox Option to Config screen for
- 'Remind me to Close PDFViewer' Default yes
- v0.94 05/26/2000 Added Checkbox Options to Config screen for Default no for all these
- 'Show Save as Dialog Automatically',
- 'Launch PDF Viewer Automatically After Conversion' and
- 'Exit FreePDF After PDFViewer Close'
- About box is now a real window also instead of just Dialog Box
- v0.88 05/26/2000 Code Cleanup
- v0.87 05/19/2000 First Beta Release. Small bugs Squashed!
-
- Still Working on the Update checker..
- For now look for the latest version yourself at
- \thttp://over.to/freepdf.
-
- Hope you like it!
- E-Mail Feedback Comments to: freepdf@over.to
-
- $pgmName is Copyright ⌐ 2000, BMRWare. All rights reserved.
- PDF (Portable Doument Format) is Copyright ⌐2000 Adobe Systems Incorporated.
- "
- $w.text insert end "\n
- \t\t Zipguy says 'Enjoy!' ;-)"
-
- button $w.exit\
- -text "Exit"\
- -command "destroy .about" -padx 0 -pady 0
- #### button $w.homepage\
- #### -text "Homepage"\
- #### -command "exec C://Progra~1//Intern~1//IEXPLORE.EXE http://over.to/freepdf" -padx 0 -pady 0
- #### pack $w.homepage -side left -expand 1
- pack $w.exit -side left -expand 1
-
-
- }
-
-
-
- #*****************************************************************
- #*****************************************************************
- #*****************************************************************
- # START OF MAIN CODE
- #*****************************************************************
- #*****************************************************************
- #*****************************************************************
-
- frame .buttons -relief raised -borderwidth 1
- set f .buttons
- pack $f\
- -side top -fill x -pady 0m
- # Want 2 paramters
-
- # ----------------------------------------------------------------
- # Create the View PDF, Show Command,
- # Configure, About and Exit Button
- # ----------------------------------------------------------------
- button $f.makePdf\
- -text "Save PDF as.." \
- -command "MakePDF" -padx 0 -pady 0
- button $f.viewPdf\
- -text "View PDF" \
- -command "CallPdfViewer" -padx 0 -pady 0
- button $f.configure\
- -text "Configure" \
- -command "Configure" -padx 0 -pady 0
- button $f.seeCommand\
- -text "GS Command"\
- -command "SeeCommand" -padx 0 -pady 0
- button $f.exit\
- -text "Exit"\
- -command "destroy ." -padx 0 -pady 0
- button $f.about\
- -text "About"\
- -command "About" -padx 0 -pady 0
- pack $f.makePdf -side left -expand 1
- pack $f.viewPdf -side left -expand 1
- pack $f.configure -side left -expand 1
- pack $f.seeCommand -side left -expand 1
- pack $f.about -side left -expand 1
- pack $f.exit -side left -expand 1
-
- # ----------------------------------------------------------------
- # Create the Screen Text
- # ----------------------------------------------------------------
- frame .ftxt -relief sunken
- frame .ftxt.ftxt1
- set f .ftxt.ftxt1
- pack $f\
- -side top -fill x -pady 0m
- label $f.txtFile \
- -textvariable text1 \
- -anchor w -justify left
- set text1 "Input file to be converted to PDF is \n<$parm1>\n
- Click the 'Save PDF as..' button, to create your PDF"
- pack $f.txtFile\
- -side left
-
- frame .ftxt.ftxt2
- set f .ftxt.ftxt2
- pack $f\
- -side top -fill x -pady 0m
- label $f.txtButtonExp \
- -textvariable text2 \
- -anchor w -justify left
- set text2 ""
- pack $f.txtButtonExp\
- -side left
- pack $f\
- -fill x -padx 0 -pady 0
- pack .ftxt\
- -side left
- # if [expr $testing < 1] {
- # } ;# End if
-
- if [expr $argc < 2] {
- # getting here means not enough parms passed!
- set errorflag 1
- set pdfSaveAsImmed 0
- set pdfAutoView 1
- set pdfRemindPdfView 1
- set pdfQuickExit 0
- WriteIni
- frame .ftxt.fparm
- set f .ftxt.fparm
- label $f.labbad -text "$pgmName $ver - Error!
- Less than 2 Parameters Recieved!
- FreePDF Received the following - <$argv>\n
- Use the 'Open PS' button below to specify input PostScript file!"\
- -anchor w
- pack $f.labbad\
- -side top
-
- button $f.openPS\
- -text "Pick Input PS" -command "OpenPS" -padx 0 -pady 0
- pack $f.openPS -side bottom -expand 1
- pack $f \
- -fill x -padx 0 -pady 0
- }
-
- if {$errorflag < 1} {
- ReadIni
- if {$pdfSaveAsImmed > 0} {
- update
- MakePDF
- }
- }
-
-
-